#include <bits/stdc++.h>
using namespace std;

int main() {
    int n, m;
    cin >> n >> m;
    vector<bool> vis(n, false);
    for (int i = 2; i <= m; ++i)
        for (int j = i; j <= n; j += i)
            vis[j] = (!vis[j]);
    cout << 1;
    for (int i = 3; i <= n; ++i)
        if (!vis[i])
            cout << ',' << i;
    cout << endl;
    return 0;
}